package interceptor;

import entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

@Controller
@RequestMapping("/inter")
public class LoginCtrl {
    @PostMapping("/login")
    String login(User u, HttpSession session){
        System.out.println("name:"+u.getName()+",pass"+u.getPass());
        session.setAttribute("user" ,u);
        return "redirect:/inter/success";
    }
}
